<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:xx-large; color:#000000; background-color:#f8f9fa;">Кортежи (tuple) в Python: основные методы и функции</span></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 21.03.2022</li>
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> 133</li>
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <a href="https://fullstacker.ru/category/python-base"><span style=" text-decoration: underline; color:#0000ff;">Основы Python</span></a></li>
<li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <a href="https://fullstacker.ru/tag/python-data-types"><span style=" text-decoration: underline; color:#0000ff;">Типы данных</span></a></li>
<li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> <a href="https://fullstacker.ru/tag/python-tuple"><span style=" text-decoration: underline; color:#0000ff;">Кортежи</span></a></li></ul>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px;">Кортеж — индексированная последовательность значений, как и список, но в отличии от него, <span style=" font-weight:600;">значения в кортеже изменить нельзя</span>.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">С</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">оздание кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Кортежи создаются в круглых скобках:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_2 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_2</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#(1, 2, 3, 4, 5)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('один', 'два', 'три', 'четыре', 'пять')</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Также можно делать запись и без скобок, просто перечисляя последовательность:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#(1, 2, 3, 4, 5)</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Тип данных:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">type</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#&lt;class 'tuple'&gt;</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Так, как кортеж не изменяемая последовательность, то если попытаться изменить значение в кортеже, то будет ошибка:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">]</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">10</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#builtins.TypeError: 'tuple' object does not support item assignment</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Зачем вообще пользоваться кортежами, если есть</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"> </span><a href="https://fullstacker.ru/spiski-v-python-operatsii-funktsii-i-osnovnye-metody"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; text-decoration: underline; color:#000000;">списки</span></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">?</span></p>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16px;">Неизменяемость. Если вам нужно, чтобы значения были всегда постоянными.</span></li>
<li style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16px;">Скорость. Кортежи работают быстрее списков (как раз по причине неизменяемости).</span></li>
<li style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16px;">Безопасность. Т.к. в Python нет констант, то использование кортежей в роли констант, дадут требуемую неизменяемость констант.</span></li>
<li style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16px;">Кортежи можно использовать в качестве ключей у словарей.</span></li></ul>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%B8%D0%BD%D0%B4%D0%B5%D0%BA%D1%81%D0%B0%D1%86%D0%B8%D1%8F-%D0%B8-%D1%81%D1%80%D0%B5%D0%B7%D1%8B-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">И</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">ндексация и срезы кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Здесь все аналогично спискам.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%B8%D0%BD%D0%B4%D0%B5%D0%BA%D1%81%D0%B0%D1%86%D0%B8%D1%8F-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">И</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">ндексация кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Индексация элементов начинается с 0:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#9a6e3a;">+---+---+---+---+---+---+</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span><span style=" font-family:'Consolas';"> p </span><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span><span style=" font-family:'Consolas';"> y </span><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span><span style=" font-family:'Consolas';"> t </span><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span><span style=" font-family:'Consolas';"> h </span><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span><span style=" font-family:'Consolas';"> o </span><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span><span style=" font-family:'Consolas';"> n </span><span style=" font-family:'Consolas'; color:#9a6e3a;">|</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#9a6e3a;">+---+---+---+---+---+---+</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">  </span><span style=" font-family:'Consolas'; color:#990055;">0</span><span style=" font-family:'Consolas';">   </span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas';">   </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas';">   </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas';">   </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas';">   </span><span style=" font-family:'Consolas'; color:#990055;">5</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;"> </span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">6</span><span style=" font-family:'Consolas';">  </span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas';">  </span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas';">  </span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas';">  </span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas';">  </span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">1</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять!'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#990055;">0</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#один</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#три</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#пять!</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D1%81%D1%80%D0%B5%D0%B7%D1%8B-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">С</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">резы кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Формула среза в кортежах, такая же, как и в списках</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"> </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">X</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">[</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">I</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">:</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">J</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">:</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">Step</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">]</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">.<br />Извлечь все содержимое кортежа </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">Х</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">, начиная со смещения </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">I</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"> до смещения </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">J</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">, не включая его, с шагом </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">Step</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять!'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">:</span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">:])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[:</span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[::</span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('два', 'три', 'четыре')</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('два', 'три', 'четыре', 'пять!')</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('один', 'два', 'три')</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('один', 'три', 'пять!')</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять!'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">[::</span><span style=" font-family:'Consolas'; color:#9a6e3a;">-</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">])</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('пять!', 'четыре', 'три', 'два', 'один')</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0-%D1%81-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B0%D0%BC%D0%B8"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">Р</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">абота с кортежами</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%BE%D0%B1%D1%8A%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">О</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">бъединение кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_2 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas'; color:#990055;">6</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas'; color:#990055;">7</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas'; color:#990055;">8</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_3 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">+</span><span style=" font-family:'Consolas';"> my_tuple_2</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_3</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#(1, 2, 3, 4, 5, 6, 7, 8)</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_2 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_3 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">+</span><span style=" font-family:'Consolas';"> my_tuple_2</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_3</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('один', 'два', 'три', 'четыре', 'пять')</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%BF%D0%BE%D0%B2%D1%82%D0%BE%D1%80%D0%B5%D0%BD%D0%B8%D0%B5-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">П</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">овторение кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_2 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">*</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_2</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#(1, 2, 3, 1, 2, 3)</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_2 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">*</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_2</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('один', 'два', 'три', 'один', 'два', 'три', 'один', 'два', 'три')</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%BF%D1%80%D0%B8%D1%81%D0%B2%D0%BE%D0%B5%D0%BD%D0%B8%D0%B5-%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B9-%D0%BF%D0%B5%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%BD%D1%8B%D0%BC-%D1%81-%D0%BF%D0%BE%D0%BC%D0%BE%D1%89%D1%8C%D1%8E-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">П</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:large; font-weight:496; color:#444444; background-color:#f8f9fa;">рисвоение значений переменным с помощью кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">a</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> b</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> c</span><span style=" font-family:'Consolas'; color:#999999;">)</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> my_tuple</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">a</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">b</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">c</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#1</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#2</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#3</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Здесь два кортежа, один с</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"> </span><a href="https://fullstacker.ru/glavnoe-o-peremennyh-v-python-obyavlenie-prisvaivanie-udalenie-imenovanie"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; text-decoration: underline; color:#000000;">переменными</span></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">, второй со значениями переменных. Переменным из кортежа присваиваем значения из значения из первого кортежа </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">my_tuple</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D1%8B%D0%B5-%D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D1%8B-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">О</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">сновные методы кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Т.к. кортежи неизменяемы, то у них нет многих методов, которые есть у списков. Рассмотрим наиболее часто употребляемые методы кортежей.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Длина кортежа</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">len</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">(</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">t</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">len</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_1</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#3</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Количество элементов х в кортеже: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; font-weight:600; color:#669900; background-color:#f0f1f3;">tuple</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; font-weight:600; color:#999999; background-color:#f0f1f3;">.</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; font-weight:600; color:#000000; background-color:#f0f1f3;">count</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; font-weight:600; color:#999999; background-color:#f0f1f3;">(</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; font-weight:600; color:#000000; background-color:#f0f1f3;">x</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; font-weight:600; color:#999999; background-color:#f0f1f3;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple_1 </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple_1</span><span style=" font-family:'Consolas'; color:#999999;">.</span><span style=" font-family:'Consolas';">count</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#2</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Найти индекс элемента x</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">tuple</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">.</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">index</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">(</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">x</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">[,</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;"> start</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">[,</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;"> end</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">]])</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"><br />Необязательные аргументы </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">start</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"> и </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#000000; background-color:#f0f1f3;">end</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">, указывают на промежуток поиска:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">.</span><span style=" font-family:'Consolas';">index</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#3</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">.</span><span style=" font-family:'Consolas';">index</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#2</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Если элемента нет в списке:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять'</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">.</span><span style=" font-family:'Consolas';">index</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">'шесть'</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#builtins.ValueError: tuple.index(x): x not in tuple</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; line-height:1.2%; background-color:#f8f9fa;"><a name="%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D1%8B%D0%B5-%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B8-%D0%BA%D0%BE%D1%80%D1%82%D0%B5%D0%B6%D0%B5%D0%B9"></a><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">О</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:x-large; font-weight:496; color:#444444; background-color:#f8f9fa;">сновные функции кортежей</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Преобразование данных в кортеж</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">tuple</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Преобразуем список в кортеж:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_list </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">[</span><span style=" font-family:'Consolas'; color:#669900;">'один'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'два'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'три'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'четыре'</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">'пять'</span><span style=" font-family:'Consolas'; color:#999999;">]</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">tuple</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_list</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">type</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#('один', 'два', 'три', 'четыре', 'пять')</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#&lt;class 'tuple'&gt;</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Максимальное значение в кортеже</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">max</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">max</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#5</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Минимальное значение в кортеже</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">min</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">min</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#1</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Сумма элементов кортежа</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">sum</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Работает только для числовых данных:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">sum</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#15</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; font-weight:600; color:#444444;">Сортировка элементов кортежа</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">: </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">sorted</span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#999999; background-color:#f0f1f3;">()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">my_tuple </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#990055;">3</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">1</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">2</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">4</span><span style=" font-family:'Consolas'; color:#999999;">,</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#990055;">5</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; background-color:#eff0f1;">sort </span><span style=" font-family:'Consolas'; color:#9a6e3a;">=</span><span style=" font-family:'Consolas';"> </span><span style=" font-family:'Consolas'; color:#669900;">sorted</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">my_tuple</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">sort</span><span style=" font-family:'Consolas'; color:#999999;">)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#0077aa;">print</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas'; color:#669900;">type</span><span style=" font-family:'Consolas'; color:#999999;">(</span><span style=" font-family:'Consolas';">sort</span><span style=" font-family:'Consolas'; color:#999999;">))</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#[1, 2, 3, 4, 5]</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#eff0f1;"><span style=" font-family:'Consolas'; color:#708090;">#&lt;class 'list'&gt;</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10px;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; background-color:#f8f9fa;"><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444; background-color:#f8f9fa;">Но важно заметить, что после сортировки тип будет уже</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;"> </span><span style=" font-family:'Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace'; font-size:16px; color:#669900; background-color:#f0f1f3;">list</span><span style=" font-family:'system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Liberation Sans,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji'; font-size:16px; color:#444444;">, т.е. список, а не кортеж.</span></p></body></html>